const getExpireKey = key => key + '_expire_time'
const setStorageSync = (key, value,expire) => {
    if (expire) {
        let time = new Date().getTime() + expire * 1000
        time && uni.setStorageSync(getExpireKey(key), time)
    }
    uni.setStorageSync(key, value)
}
const getStorageSync = key => {
    let expire = uni.getStorageSync(getExpireKey(key))
    if (expire && expire < new Date().getTime()) {
        uni.removeStorageSync(getExpireKey(key))
        uni.removeStorageSync(key)
    }
    return uni.getStorageSync(key)
}
//抛出其他文件引用
export {
    getStorageSync,
    setStorageSync
}
